/**
 *  @file StringWriter.h
 */
#ifndef _STRINGWRITER_H_
#define _STRINGWRITER_H_

#include "Writer.h"

namespace cppflib
{

namespace io
{

/**
 *  Write characters to an internal string buffer
 */
class _DLLAPI StringWriter : public Writer
{
private:
    CFString *pStringBuf;

public:
	StringWriter(void);
    explicit StringWriter(sz_t internalBufSize);
	virtual ~StringWriter(void);

    virtual void Close();
    virtual void Flush();
    virtual void Write(collections::ArrayWChar &buffer);
    virtual void Write(collections::ArrayWChar &buffer, int offset, int count);
    virtual void Write(const CFString &str);
    virtual void Write(const CFString &str, int offset, int count);
    virtual void Write(int c);

    CFString & GetStringBuffer();
};

} // end of namespace io

} // end of namespace cppflib


#endif
